*/
class MySQLField implements Field {
private $name, $tablename, $default, $max_length, $nullable,
- $is_pk, $is_unique, $is_multiple, $is_key, $type, $binary;
+ $is_pk, $is_unique, $is_multiple, $is_key, $type, $binary,
+ $is_numeric, $is_blob, $is_unsigned, $is_zerofill;
function __construct( $info ) {
$this->name = $info->name;
$this->is_multiple = $info->multiple_key;
$this->is_key = ( $this->is_pk || $this->is_unique || $this->is_multiple );
$this->type = $info->type;
- $this->flags = $info->flags;
$this->binary = isset( $info->binary ) ? $info->binary : false;
+ $this->is_numeric = isset( $info->numeric ) ? $info->numeric : false;
+ $this->is_blob = isset( $info->blob ) ? $info->blob : false;
+ $this->is_unsigned = isset( $info->unsigned ) ? $info->unsigned : false;
+ $this->is_zerofill = isset( $info->zerofill ) ? $info->zerofill : false;
}
/**
}
/**
- * @return int
+ * @return bool
*/
- function flags() {
- return $this->flags;
- }
-
function isBinary() {
return $this->binary;
}
+
+ /**
+ * @return bool
+ */
+ function isNumeric() {
+ return $this->is_numeric;
+ }
+
+ /**
+ * @return bool
+ */
+ function isBlob() {
+ return $this->is_blob;
+ }
+
+ /**
+ * @return bool
+ */
+ function isUnsigned() {
+ return $this->is_unsigned;
+ }
+
+ /**
+ * @return bool
+ */
+ function isZerofill() {
+ return $this->is_zerofill;
+ }
}
class MySQLMasterPos implements DBMasterPos {
*/
protected function mysqlFetchField( $res, $n ) {
$field = $res->fetch_field_direct( $n );
+
+ // Add missing properties to result (using flags property)
+ // which will be part of function mysql-fetch-field for backward compatibility
$field->not_null = $field->flags & MYSQLI_NOT_NULL_FLAG;
$field->primary_key = $field->flags & MYSQLI_PRI_KEY_FLAG;
$field->unique_key = $field->flags & MYSQLI_UNIQUE_KEY_FLAG;
$field->multiple_key = $field->flags & MYSQLI_MULTIPLE_KEY_FLAG;
$field->binary = $field->flags & MYSQLI_BINARY_FLAG;
+ $field->numeric = $field->flags & MYSQLI_NUM_FLAG;
+ $field->blob = $field->flags & MYSQLI_BLOB_FLAG;
+ $field->unsigned = $field->flags & MYSQLI_UNSIGNED_FLAG;
+ $field->zerofill = $field->flags & MYSQLI_ZEROFILL_FLAG;
return $field;
}